package com.op.teachingliteapp.fragment;

import android.app.Fragment;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.op.teachingliteapp.R;
import com.op.teachingliteapp.util.ScreenSendUtils;

/**
 * 
 * @author handsome
 *
 */
public class NotifDetailFragment extends Fragment {

	private DisplayImageOptions options;
	private View root;

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View root = inflater.inflate(R.layout.fragment_notif_detail, container,
				false);

		// 2. 设置option, 一般默认

		options = new DisplayImageOptions.Builder()
				.showImageOnLoading(R.drawable.ic_stub)
				.showImageForEmptyUri(R.drawable.ic_empty)
				.showImageOnFail(R.drawable.ic_error).cacheInMemory(true)
				.cacheOnDisk(true).considerExifParams(true)
				.bitmapConfig(Bitmap.Config.RGB_565).build();

		ImageView imageView1 = (ImageView) root.findViewById(R.id.head_image);
		TextView name_tv1 = (TextView) root.findViewById(R.id.name);
		TextView time_tv1 = (TextView) root.findViewById(R.id.time);
		TextView title = (TextView) root.findViewById(R.id.title);
		TextView detail_tv1 = (TextView) root
				.findViewById(R.id.notif_detail);
		// Log.i("111", ""+context);
		// 个人信息头像设置
		ImageLoader.getInstance().displayImage(
				getArguments().getString("image"), imageView1, options);
		name_tv1.setText(getArguments().getString("name"));
		time_tv1.setText(getArguments().getString("time"));
		title.setText(getArguments().getString("title"));
		detail_tv1.setText(getArguments().getString("context"));
		this.root = root;
		return root;
	}

	@Override
	public void onResume() {
		super.onResume();
		ScreenSendUtils.sendWithDely(root);

	}
}
